package com.test.service.impl;

import java.util.List;

import com.test.dao.DepartmentDao;
import com.test.domain.Department;
import com.test.service.DepartmentService;

public class DepartmentServiceImpl implements DepartmentService {
	//从容器中获得dao实例
	private DepartmentDao departmentDao;
	public DepartmentDao getDepartmentDao() {
		return departmentDao;
	}
	public void setDepartmentDao(DepartmentDao departmentDao) {
		this.departmentDao = departmentDao;
	}

	public List<Department> SearchDepartment(Department department,
			int firstResult, int maxResults) {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean addDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentDao.add(department);
	}

	public boolean deleteDepartment(Integer id) {
		// TODO Auto-generated method stub
		return departmentDao.delete(id);
	}

	public List<Department> findAll() {
		// TODO Auto-generated method stub
		return departmentDao.findAll();
	}

	public Department findDepartmentById(Integer id) {
		// TODO Auto-generated method stub
		return departmentDao.getById(id);
	}

	public boolean updateDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentDao.update(department);
	}
	public List<Department> findChildren(Integer id) {
		// TODO Auto-generated method stub
		return departmentDao.getChildren(id);
	}
	public List<Department> findTopList() {
		// TODO Auto-generated method stub
		return departmentDao.getTopList();
	}

}
